package com.zhouyu.service;

import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserService implements BeanNameAware {

	private String beanName;

	@Autowired
	private UserService userService;

	public void test()
	{
		System.out.println(userService);
	}

	@Override
	public void setBeanName(@NotNull String name)
	{
		beanName = name;
	}

	@Override
	public String toString()
	{
		return "UserService{" +
				"beanName='" + beanName + '\'' +
				'}';
	}
}
